package training.project.app.web.converters;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import training.project.app.domain.UserAccount;
import training.project.app.service.UserService;

@Component
public class StringClientConverter implements Converter<String, UserAccount> {
 
    @Autowired
	private UserService clientService;
     
    @Override
    public UserAccount convert(String clientId) {
        return clientService.getUserById(new Integer(clientId));
    }
 
}
